fix: handle paste events in pair and rename inputs - #22
Merged
Conversation
PasteMsg is a distinct message type in Bubbletea v2 — it never routes through KeyPressMsg, so Cmd+V was silently dropped. Add a PasteMsg case in Update that appends to pairInput or renameInput when the respective mode is active, filtering non-printable characters. Fixes: p key pair input, r rename input both now accept paste.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Pressing
pon the Connect screen opens the pair-by-ID input, but Cmd+V / Ctrl+V to paste a device ID did nothing. Same issue with the rename input (r). You had to type the full ID manually.Root cause
PasteMsgis a distinct message type in Bubbletea v2 — it never routes throughKeyPressMsg. TheUpdateswitch only handledtea.KeyPressMsg, so paste events were silently dropped.Fix
Added a
tea.PasteMsgcase inUpdatethat appends topairInputorrenameInputwhen the respective mode is active. Non-printable characters are filtered out (same policy as the key handler).Testing
p→ paste a full device ID → enter → device added ✓r→ paste a new name → enter → device renamed ✓🤖 Generated with Claude Code